Optimal. Leaf size=209 \[ \frac {a^{5/2} (163 B+200 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 d}+\frac {a^3 (163 B+200 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {a^3 (95 B+104 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}+\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.46, antiderivative size = 209, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 42, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4157, 4102,
4100, 3890, 3859, 209} \begin {gather*} \frac {a^{5/2} (163 B+200 C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{64 d}+\frac {a^3 (163 B+200 C) \sin (c+d x)}{64 d \sqrt {a \sec (c+d x)+a}}+\frac {a^3 (95 B+104 C) \sin (c+d x) \cos (c+d x)}{96 d \sqrt {a \sec (c+d x)+a}}+\frac {a^2 (11 B+8 C) \sin (c+d x) \cos ^2(c+d x) \sqrt {a \sec (c+d x)+a}}{24 d}+\frac {a B \sin (c+d x) \cos ^3(c+d x) (a \sec (c+d x)+a)^{3/2}}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 3890
Rule 4100
Rule 4102
Rule 4157
Rubi steps
\begin {align*} \int \cos ^5(c+d x) (a+a \sec (c+d x))^{5/2} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^4(c+d x) (a+a \sec (c+d x))^{5/2} (B+C \sec (c+d x)) \, dx\\ &=\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}+\frac {1}{4} \int \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \left (\frac {1}{2} a (11 B+8 C)+\frac {1}{2} a (3 B+8 C) \sec (c+d x)\right ) \, dx\\ &=\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}+\frac {1}{12} \int \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \left (\frac {1}{4} a^2 (95 B+104 C)+\frac {3}{4} a^2 (17 B+24 C) \sec (c+d x)\right ) \, dx\\ &=\frac {a^3 (95 B+104 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}+\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}+\frac {1}{64} \left (a^2 (163 B+200 C)\right ) \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {a^3 (163 B+200 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {a^3 (95 B+104 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}+\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}+\frac {1}{128} \left (a^2 (163 B+200 C)\right ) \int \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {a^3 (163 B+200 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {a^3 (95 B+104 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}+\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}-\frac {\left (a^3 (163 B+200 C)\right ) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 d}\\ &=\frac {a^{5/2} (163 B+200 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{64 d}+\frac {a^3 (163 B+200 C) \sin (c+d x)}{64 d \sqrt {a+a \sec (c+d x)}}+\frac {a^3 (95 B+104 C) \cos (c+d x) \sin (c+d x)}{96 d \sqrt {a+a \sec (c+d x)}}+\frac {a^2 (11 B+8 C) \cos ^2(c+d x) \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{24 d}+\frac {a B \cos ^3(c+d x) (a+a \sec (c+d x))^{3/2} \sin (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 1.35, size = 366, normalized size = 1.75 \begin {gather*} \frac {a^2 \left (6075 B \tanh ^{-1}\left (\sqrt {1-\sec (c+d x)}\right )+6600 C \tanh ^{-1}\left (\sqrt {1-\sec (c+d x)}\right )+2079 B \sqrt {1-\sec (c+d x)}+1240 C \sqrt {1-\sec (c+d x)}+7641 B \cos (c+d x) \sqrt {1-\sec (c+d x)}+6360 C \cos (c+d x) \sqrt {1-\sec (c+d x)}+2097 B \cos (2 (c+d x)) \sqrt {1-\sec (c+d x)}+1240 C \cos (2 (c+d x)) \sqrt {1-\sec (c+d x)}+522 B \cos (3 (c+d x)) \sqrt {1-\sec (c+d x)}-80 C \cos (3 (c+d x)) \sqrt {1-\sec (c+d x)}+18 B \cos (4 (c+d x)) \sqrt {1-\sec (c+d x)}+7680 C \, _2F_1\left (\frac {1}{2},4;\frac {3}{2};1-\sec (c+d x)\right ) \sqrt {1-\sec (c+d x)}+4608 B \, _2F_1\left (\frac {1}{2},5;\frac {3}{2};1-\sec (c+d x)\right ) \sqrt {1-\sec (c+d x)}\right ) \sqrt {a (1+\sec (c+d x))} \sin (c+d x)}{2880 d (1+\cos (c+d x)) \sqrt {1-\sec (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(764\) vs.
\(2(185)=370\).
time = 26.17, size = 765, normalized size = 3.66
method | result | size |
default | \(\frac {\left (489 B \left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}+600 C \sqrt {2}\, \sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right )+1467 B \left (\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}+1800 C \sqrt {2}\, \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right )+1467 B \cos \left (d x +c \right ) \sin \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {2}+1800 C \sqrt {2}\, \sin \left (d x +c \right ) \cos \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right )+489 B \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )+600 C \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {7}{2}} \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sin \left (d x +c \right )-768 B \left (\cos ^{8}\left (d x +c \right )\right )-2176 B \left (\cos ^{7}\left (d x +c \right )\right )-1024 C \left (\cos ^{7}\left (d x +c \right )\right )-2272 B \left (\cos ^{6}\left (d x +c \right )\right )-3328 C \left (\cos ^{6}\left (d x +c \right )\right )-2608 B \left (\cos ^{5}\left (d x +c \right )\right )-5248 C \left (\cos ^{5}\left (d x +c \right )\right )+7824 B \left (\cos ^{4}\left (d x +c \right )\right )+9600 C \left (\cos ^{4}\left (d x +c \right )\right )\right ) \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, a^{2}}{3072 d \sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}\) | \(765\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.96, size = 420, normalized size = 2.01 \begin {gather*} \left [\frac {3 \, {\left ({\left (163 \, B + 200 \, C\right )} a^{2} \cos \left (d x + c\right ) + {\left (163 \, B + 200 \, C\right )} a^{2}\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (48 \, B a^{2} \cos \left (d x + c\right )^{4} + 8 \, {\left (23 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} + 2 \, {\left (163 \, B + 136 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (163 \, B + 200 \, C\right )} a^{2} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{384 \, {\left (d \cos \left (d x + c\right ) + d\right )}}, -\frac {3 \, {\left ({\left (163 \, B + 200 \, C\right )} a^{2} \cos \left (d x + c\right ) + {\left (163 \, B + 200 \, C\right )} a^{2}\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (48 \, B a^{2} \cos \left (d x + c\right )^{4} + 8 \, {\left (23 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} + 2 \, {\left (163 \, B + 136 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (163 \, B + 200 \, C\right )} a^{2} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{192 \, {\left (d \cos \left (d x + c\right ) + d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1096 vs.
\(2 (185) = 370\).
time = 2.44, size = 1096, normalized size = 5.24 \begin {gather*} -\frac {3 \, {\left (163 \, B \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 200 \, C \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right ) - 3 \, {\left (163 \, B \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 200 \, C \sqrt {-a} a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right ) + \frac {4 \, \sqrt {2} {\left (489 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{14} B \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 600 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{14} C \sqrt {-a} a^{3} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 10269 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{12} B \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 12600 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{12} C \sqrt {-a} a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 69885 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{10} B \sqrt {-a} a^{5} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 103992 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{10} C \sqrt {-a} a^{5} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 259233 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{8} B \sqrt {-a} a^{6} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 339864 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{8} C \sqrt {-a} a^{6} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 209979 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} B \sqrt {-a} a^{7} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 262920 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} C \sqrt {-a} a^{7} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 55511 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} B \sqrt {-a} a^{8} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 73640 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} C \sqrt {-a} a^{8} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 6687 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} B \sqrt {-a} a^{9} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 8808 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} C \sqrt {-a} a^{9} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 299 \, B \sqrt {-a} a^{10} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 392 \, C \sqrt {-a} a^{10} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{4}}}{384 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\cos \left (c+d\,x\right )}^5\,\left (\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^{5/2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________